var Person = require('./person.js');
var util = require('util');

function Student(){
	Person.call(this);
	// 函数Override
	this.sleep = function(){
		console.log('can\'t sleep');
	}
}

util.inherits(Student, Person);

Student.prototype.study = function(){
	console.log('study');
}

/* wrong override
Student.prototype.eat = function(){
	console.log('can\'t eat');
}*/

module.exports = Student;

/*
function Worker(){
Person.call(this);
util.inherits(Worker, Person);
this.study = function(){
	console.log('work-hard');
}
}
module.exports = Worker;

// 当require该文件时，将会得到一个动态Student类，通常这样来调用
// var stu = new Student();
// stu.functionX();

*/
